﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IMS_1._0
{
    public partial class Main_Admin : Form
    {
        public Main_Admin()
        {
            InitializeComponent();
        }

        private void Screen_1_Load(object sender, EventArgs e)
        {

        }

      /*Function*/

       
      /*Inquiry-Tab*/

        // Add-Inquiry Inquiry-Tab
        private void Add_Inquiry_btn_inquriy_tab_Click(object sender, EventArgs e)
        {
            disablehideall();
            Add_inq_p_inqtab.Enabled = true;
            Add_inq_p_inqtab.Visible = true;
            Path_label.Text = "Inquiry > Add Inquiry";
        }

        private void email_id_addinq_inq_p_TextChanged(object sender, EventArgs e)
        {
            Valaditions v= new Valaditions();
            v.email_id(email_id_addinq_inq_p.Text);
        }
        ///... Add-Inquiry Inquiry-Tab End
        /// ...Edit-Inquiry Inquiry-Tab Begins
        private void Edit_inquiry_btn_Click(object sender, EventArgs e)
        {
            disablehideall();
            panel_search_report_admin_main.Visible = true;
            panel_search_report_admin_main.Enabled = true;
            Path_label.Text = "Inquiry > Edit Inquiry";
        }
        /* Inquiry-Tab End*/
        // help_tab
        private void about_optimus_ims_bt_help_tab_Click(object sender, EventArgs e)
        {
            Path_label.Text = "Help > About Us";
            Contact_US_tab_gb.Visible = false;
            about_us_tab_gb.Visible = true;
        }
        private void Con_us_bt_helptb_Click(object sender, EventArgs e)
        {
            Path_label.Text = "Help > Contact Us";
            Contact_US_tab_gb.Visible = true;
            about_us_tab_gb.Visible = false;
        }

        
        // help_tab_ends
        void disablehideall()
        {
            Add_inq_p_inqtab.Visible = false;
            Add_inq_p_inqtab.Enabled = false;
            panel_search_report_admin_main.Visible = false;
            panel_search_report_admin_main.Enabled = false;
            follow_inquriy.Visible = false;
            follow_inquriy.Enabled = false;
            panel2_search_report_admin_main.Visible = false;
            panel2_search_report_admin_main.Enabled = false;
        }

        private void follow_up_btn_Click(object sender, EventArgs e)
        {
            disablehideall();
            follow_inquriy.Enabled = true;
            follow_inquriy.Visible = true;
            Path_label.Text = "Inquiry > Follow Up";
        }

        private void inqreport_btn_Click(object sender, EventArgs e)
        {
            disablehideall();
            panel2_search_report_admin_main.Visible = true;
            panel2_search_report_admin_main.Enabled = true;
            Path_label.Text = "Inquiry > Inquiry Report";
        }

        private void Main_tabs_Selected(object sender, TabControlEventArgs e)
        {

        }

        private void Inquiry_Tab_Click(object sender, EventArgs e)
        {
            disablehideall();
        }

        private void Main_tabs_Click(object sender, EventArgs e)
        {
            disablehideall();
        }
    }

    public class Valaditions
    {
        public int email_id(string email)
        {
            int i;
            bool res=true;
            
           //Char emailid[] Array = email.ToCharArray();
            Array temp;
            temp = email.ToCharArray();
            for (i = 0; i < email.Count(); i++)
            {
                //if (emailid[i] == '!')
                //{
                //    res = false;
                //}
            }
            if (res == false)
            {
                i= 1;
            }
            else if(res == true)
            {
                i= 0;
            }
            return i;
        }
    }
}
